﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace SageKing.Core.Extensions;

public static class HttpContextExts
{
    public static string GetRemoteIpAddress(this HttpContext httpContent)
    {
        return $"{httpContent.Connection.RemoteIpAddress}:{httpContent.Connection.RemotePort}";
    }
    public static string GetLocalIpAddress(this HttpContext httpContent)
    {
        return $"{httpContent.Connection.LocalIpAddress}:{httpContent.Connection.LocalPort}";
    }
}
